package com.hooya.fa.eu.api.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2024/4/24
 * @Version 1.0.0
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum CkEnum {

    /**
     * type 解释
     * 1:"List<String>"
     * 2:"Map<String, String>"
     * 3:"Map<String, List<String>>"
     * 4:"Map<String, Map<String, List<String>>>"
     */
    FBA_CK_MAP("fbaCkMap", 2, "Map<String, String>", true),

    FBA_CK_REVERSAL_MAP("fbaCkReversalMap", 3, "Map<String, List<String>>", true),

    FBA_CK_COSTWAY_MAP("fbaCkCostwayMap", 4, "Map<String, Map<String, List<String>>>", true),

    COUNTRY_CK_MAP("countryCkMap", 3, "Map<String, List<String>>", true),

    SF_CK_LIST("sfCkList", 1, "List<String>", true),

    FBA_WL_LIST("fbaWlList", 1, "List<String>", true),

    OEU_ORDER_MAP("oeuOrderMap", 2, "Map<String, String>", false),

    ABNORMAL_BELONGS_MAP("abnormalBelongsMap", 2, "Map<String, String>", false),

    XS_OTHER_LIST("xsOtherCkList", 1, "List<String>", true),

    RESTOCK_MARK_LIST("restockMarkList", 1, "List<String>", true),

    STORE("store", 1, "List<String>", false),
    ;

    private String name;

    private Integer type;

    private String description;

    private boolean isSystem;

    public static int getTypeByName(String name) {
        for (CkEnum value : CkEnum.values()) {
            if (value.name.equals(name)) {
                return value.type;
            }
        }
        return 0;
    }

    public static String getDescByName(String name) {
        for (CkEnum value : CkEnum.values()) {
            if (value.name.equals(name)) {
                return value.description;
            }
        }
        return "";
    }

    public static Boolean getSystemFlagByName(String name) {
        for (CkEnum value : CkEnum.values()) {
            if (value.name.equals(name)) {
                return value.isSystem;
            }
        }
        return true;
    }

}
